!pip install tensorflow==2.0.0-alpha0 

import tensorflow as tf 
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers

inputs = keras.Input(shape=(784,))
dense1 = layers.Dense(1568, activation='relu')
x = dense1(inputs)
dense2 = layers.Dense(3136, activation='relu')
x2 = dense2(x)
dense2 = layers.Dense(784, activation='relu')
outputs = dense2(x2)

model = keras.Model(inputs=inputs, outputs=outputs)

inputs = keras.Input(shape=(784,))
dense1 = layers.Dense(1568, activation='relu')
x = dense1(inputs)
dense2 = layers.Dense(3136, activation='relu')
x2 = dense2(x)
dense2 = layers.Dense(784, activation='relu')
outputs = dense2(x2)

model = keras.Model(inputs=inputs, outputs=outputs)

model.summary()

keras.utils.plot_model(model, 'my_first_model_with_shape_info.png', show_shapes=True)

model.compile(loss='binary_crossentropy',
              optimizer=keras.optimizers.RMSprop(),
              metrics=['accuracy'])

tr = np.random.uniform(-1, 1, [1, 784])
tr2 = np.random.uniform(-1, 1, [1, 784])

print(tr)

test_scores = model.evaluate( tr, tr2 , verbose=1)

print(test_scores)

test_scores = model.predict( tr)

print(test_scores)

test_scores.shape
